#[derive(Debug)]
struct Queue<T> {
  items: Vec<T>,
}

impl<T> Queue<T> {
  fn new() -> Self {
    Queue { items: Vec::new() }
  }

  fn push(&mut self, item: T) {
    self.items.push(item);
  }

  fn pop(&mut self) -> Option<T> {
    if self.items.len() > 0 {
      Some(self.items.remove(0))
    } else {
      None
    }
  }
}

#[test]
fn test_queue() {
  let mut queue = Queue::new();
  queue.push(10);
  queue.push(11);
  queue.push(12);
  assert_eq!(queue.pop().unwrap(), 10);
  assert_eq!(queue.pop().unwrap(), 11);
  assert_eq!(queue.pop().unwrap(), 12);
  assert_eq!(queue.pop(), None);
}

